export gtk_binary_age and gtk_interface_age.
authorTim Janik <timj@gtk.org>
Sun, 19 Jul 1998 19:09:27 +0000 (19:09 +0000)
committerTim Janik <timj@src.gnome.org>
Sun, 19 Jul 1998 19:09:27 +0000 (19:09 +0000)
Sat Jul 18 22:59:04 1998  Tim Janik  <timj@gtk.org>

        * gtk/gtkmain.h:
        * gtk/gtkmain.c: export gtk_binary_age and gtk_interface_age.

        * gtk/gtktypeutils.h:
        * gtk/gtkitemfactory.h: remove "void" from prototypes again.

Sat Jul 18 00:54:01 1998  Lars Hamann  <lars@gtk.org>

        * gtk/gtknotebook.c (gtk_notebook_set_child_arg): added support for
        CHILD_ARG_MENU_LABEL, CHILD_ARG_TAB_LABEL
        (gtk_notebook_get_child_arg): added support for CHILD_ARG_MENU_LABEL,
        CHILD_ARG_POSITION
        (gtk_notebook_reorder_child): new funktion to change position of a
        notebook page
        (gtk_notebook_draw_arrow): draw left/right arrow with
        GTK_SHADOW_ETCHED_IN if focus_tab is first/last tab.

        * gtk/gtkstyle.c (gtk_default_draw_arrow):
        added GTK_SHADOW_ETCHED_IN/OUT

18 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
configure.in
gtk/gtkfeatures.h.in
gtk/gtkitemfactory.h
gtk/gtkmain.c
gtk/gtkmain.h
gtk/gtknotebook.c
gtk/gtknotebook.h
gtk/gtkstyle.c
gtk/gtktypeutils.h
gtk/testgtk.c
tests/testgtk.c

index 5cdb41694e7c8acd51b2fe9e36ae676346382cb0..ad27dcc699771fd423d9ad98199cb7d7ff764732 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+Sat Jul 18 22:59:04 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.h: 
+       * gtk/gtkmain.c: export gtk_binary_age and gtk_interface_age.
+
+       * gtk/gtktypeutils.h:
+       * gtk/gtkitemfactory.h: remove "void" from prototypes again.
+
+Sat Jul 18 00:54:01 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtknotebook.c (gtk_notebook_set_child_arg): added support for
+       CHILD_ARG_MENU_LABEL, CHILD_ARG_TAB_LABEL
+       (gtk_notebook_get_child_arg): added support for CHILD_ARG_MENU_LABEL,
+       CHILD_ARG_POSITION
+       (gtk_notebook_reorder_child): new funktion to change position of a
+       notebook page
+       (gtk_notebook_draw_arrow): draw left/right arrow with
+       GTK_SHADOW_ETCHED_IN if focus_tab is first/last tab.
+
+       * gtk/gtkstyle.c (gtk_default_draw_arrow):
+       added GTK_SHADOW_ETCHED_IN/OUT
+
 Sun Jul 19 12:19:16 1998  Stefan Jeske  <stefan@gtk.org>
 
        * gtk/gtkprogress.c gtk/gtkprogress.h gtk/gtkprogressbar.c
index 5cdb41694e7c8acd51b2fe9e36ae676346382cb0..ad27dcc699771fd423d9ad98199cb7d7ff764732 100644 (file)
@@ -1,3 +1,25 @@
+Sat Jul 18 22:59:04 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.h: 
+       * gtk/gtkmain.c: export gtk_binary_age and gtk_interface_age.
+
+       * gtk/gtktypeutils.h:
+       * gtk/gtkitemfactory.h: remove "void" from prototypes again.
+
+Sat Jul 18 00:54:01 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtknotebook.c (gtk_notebook_set_child_arg): added support for
+       CHILD_ARG_MENU_LABEL, CHILD_ARG_TAB_LABEL
+       (gtk_notebook_get_child_arg): added support for CHILD_ARG_MENU_LABEL,
+       CHILD_ARG_POSITION
+       (gtk_notebook_reorder_child): new funktion to change position of a
+       notebook page
+       (gtk_notebook_draw_arrow): draw left/right arrow with
+       GTK_SHADOW_ETCHED_IN if focus_tab is first/last tab.
+
+       * gtk/gtkstyle.c (gtk_default_draw_arrow):
+       added GTK_SHADOW_ETCHED_IN/OUT
+
 Sun Jul 19 12:19:16 1998  Stefan Jeske  <stefan@gtk.org>
 
        * gtk/gtkprogress.c gtk/gtkprogress.h gtk/gtkprogressbar.c
index 5cdb41694e7c8acd51b2fe9e36ae676346382cb0..ad27dcc699771fd423d9ad98199cb7d7ff764732 100644 (file)
@@ -1,3 +1,25 @@
+Sat Jul 18 22:59:04 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.h: 
+       * gtk/gtkmain.c: export gtk_binary_age and gtk_interface_age.
+
+       * gtk/gtktypeutils.h:
+       * gtk/gtkitemfactory.h: remove "void" from prototypes again.
+
+Sat Jul 18 00:54:01 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtknotebook.c (gtk_notebook_set_child_arg): added support for
+       CHILD_ARG_MENU_LABEL, CHILD_ARG_TAB_LABEL
+       (gtk_notebook_get_child_arg): added support for CHILD_ARG_MENU_LABEL,
+       CHILD_ARG_POSITION
+       (gtk_notebook_reorder_child): new funktion to change position of a
+       notebook page
+       (gtk_notebook_draw_arrow): draw left/right arrow with
+       GTK_SHADOW_ETCHED_IN if focus_tab is first/last tab.
+
+       * gtk/gtkstyle.c (gtk_default_draw_arrow):
+       added GTK_SHADOW_ETCHED_IN/OUT
+
 Sun Jul 19 12:19:16 1998  Stefan Jeske  <stefan@gtk.org>
 
        * gtk/gtkprogress.c gtk/gtkprogress.h gtk/gtkprogressbar.c
index 5cdb41694e7c8acd51b2fe9e36ae676346382cb0..ad27dcc699771fd423d9ad98199cb7d7ff764732 100644 (file)
@@ -1,3 +1,25 @@
+Sat Jul 18 22:59:04 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.h: 
+       * gtk/gtkmain.c: export gtk_binary_age and gtk_interface_age.
+
+       * gtk/gtktypeutils.h:
+       * gtk/gtkitemfactory.h: remove "void" from prototypes again.
+
+Sat Jul 18 00:54:01 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtknotebook.c (gtk_notebook_set_child_arg): added support for
+       CHILD_ARG_MENU_LABEL, CHILD_ARG_TAB_LABEL
+       (gtk_notebook_get_child_arg): added support for CHILD_ARG_MENU_LABEL,
+       CHILD_ARG_POSITION
+       (gtk_notebook_reorder_child): new funktion to change position of a
+       notebook page
+       (gtk_notebook_draw_arrow): draw left/right arrow with
+       GTK_SHADOW_ETCHED_IN if focus_tab is first/last tab.
+
+       * gtk/gtkstyle.c (gtk_default_draw_arrow):
+       added GTK_SHADOW_ETCHED_IN/OUT
+
 Sun Jul 19 12:19:16 1998  Stefan Jeske  <stefan@gtk.org>
 
        * gtk/gtkprogress.c gtk/gtkprogress.h gtk/gtkprogressbar.c
index 5cdb41694e7c8acd51b2fe9e36ae676346382cb0..ad27dcc699771fd423d9ad98199cb7d7ff764732 100644 (file)
@@ -1,3 +1,25 @@
+Sat Jul 18 22:59:04 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.h: 
+       * gtk/gtkmain.c: export gtk_binary_age and gtk_interface_age.
+
+       * gtk/gtktypeutils.h:
+       * gtk/gtkitemfactory.h: remove "void" from prototypes again.
+
+Sat Jul 18 00:54:01 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtknotebook.c (gtk_notebook_set_child_arg): added support for
+       CHILD_ARG_MENU_LABEL, CHILD_ARG_TAB_LABEL
+       (gtk_notebook_get_child_arg): added support for CHILD_ARG_MENU_LABEL,
+       CHILD_ARG_POSITION
+       (gtk_notebook_reorder_child): new funktion to change position of a
+       notebook page
+       (gtk_notebook_draw_arrow): draw left/right arrow with
+       GTK_SHADOW_ETCHED_IN if focus_tab is first/last tab.
+
+       * gtk/gtkstyle.c (gtk_default_draw_arrow):
+       added GTK_SHADOW_ETCHED_IN/OUT
+
 Sun Jul 19 12:19:16 1998  Stefan Jeske  <stefan@gtk.org>
 
        * gtk/gtkprogress.c gtk/gtkprogress.h gtk/gtkprogressbar.c
index 5cdb41694e7c8acd51b2fe9e36ae676346382cb0..ad27dcc699771fd423d9ad98199cb7d7ff764732 100644 (file)
@@ -1,3 +1,25 @@
+Sat Jul 18 22:59:04 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.h: 
+       * gtk/gtkmain.c: export gtk_binary_age and gtk_interface_age.
+
+       * gtk/gtktypeutils.h:
+       * gtk/gtkitemfactory.h: remove "void" from prototypes again.
+
+Sat Jul 18 00:54:01 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtknotebook.c (gtk_notebook_set_child_arg): added support for
+       CHILD_ARG_MENU_LABEL, CHILD_ARG_TAB_LABEL
+       (gtk_notebook_get_child_arg): added support for CHILD_ARG_MENU_LABEL,
+       CHILD_ARG_POSITION
+       (gtk_notebook_reorder_child): new funktion to change position of a
+       notebook page
+       (gtk_notebook_draw_arrow): draw left/right arrow with
+       GTK_SHADOW_ETCHED_IN if focus_tab is first/last tab.
+
+       * gtk/gtkstyle.c (gtk_default_draw_arrow):
+       added GTK_SHADOW_ETCHED_IN/OUT
+
 Sun Jul 19 12:19:16 1998  Stefan Jeske  <stefan@gtk.org>
 
        * gtk/gtkprogress.c gtk/gtkprogress.h gtk/gtkprogressbar.c
index 5cdb41694e7c8acd51b2fe9e36ae676346382cb0..ad27dcc699771fd423d9ad98199cb7d7ff764732 100644 (file)
@@ -1,3 +1,25 @@
+Sat Jul 18 22:59:04 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.h: 
+       * gtk/gtkmain.c: export gtk_binary_age and gtk_interface_age.
+
+       * gtk/gtktypeutils.h:
+       * gtk/gtkitemfactory.h: remove "void" from prototypes again.
+
+Sat Jul 18 00:54:01 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtknotebook.c (gtk_notebook_set_child_arg): added support for
+       CHILD_ARG_MENU_LABEL, CHILD_ARG_TAB_LABEL
+       (gtk_notebook_get_child_arg): added support for CHILD_ARG_MENU_LABEL,
+       CHILD_ARG_POSITION
+       (gtk_notebook_reorder_child): new funktion to change position of a
+       notebook page
+       (gtk_notebook_draw_arrow): draw left/right arrow with
+       GTK_SHADOW_ETCHED_IN if focus_tab is first/last tab.
+
+       * gtk/gtkstyle.c (gtk_default_draw_arrow):
+       added GTK_SHADOW_ETCHED_IN/OUT
+
 Sun Jul 19 12:19:16 1998  Stefan Jeske  <stefan@gtk.org>
 
        * gtk/gtkprogress.c gtk/gtkprogress.h gtk/gtkprogressbar.c
index 344ea90e214060a04848af3e823e70197ed0bf26..2b78a6dc7ce80782af1ee641f0cf5dee928f3eef 100644 (file)
@@ -21,6 +21,8 @@ GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
 AC_SUBST(GTK_MAJOR_VERSION)
 AC_SUBST(GTK_MINOR_VERSION)
 AC_SUBST(GTK_MICRO_VERSION)
+AC_SUBST(GTK_INTERFACE_AGE)
+AC_SUBST(GTK_BINARY_AGE)
 AC_SUBST(GTK_VERSION)
 
 # libtool versioning
index dccb97f6123a2214fedd81e2c42c53414f29b490..cb68804b45c61d15d448b80cc6d02ebe9ff1874a 100644 (file)
@@ -31,6 +31,8 @@ extern "C" {
 #define GTK_MAJOR_VERSION                              (@GTK_MAJOR_VERSION@)
 #define GTK_MINOR_VERSION                              (@GTK_MINOR_VERSION@)
 #define GTK_MICRO_VERSION                              (@GTK_MICRO_VERSION@)
+#define GTK_BINARY_AGE                                 (@GTK_BINARY_AGE@)
+#define GTK_INTERFACE_AGE                              (@GTK_INTERFACE_AGE@)
 
 /* new gtk_container_set_focus_[hv]adjustment()
  */
index 620f5e0f07ccbadbc58a176aa6129ecf03a80f09..01597fb0042bba3cd34730044323910a674ab159 100644 (file)
@@ -36,7 +36,7 @@ extern "C" {
 
 typedef void   (*GtkPrintFunc)            (gpointer             func_data,
                                            gchar               *str);
-typedef        void    (*GtkItemFactoryCallback)  (void);
+typedef        void    (*GtkItemFactoryCallback)  ();
 typedef        void    (*GtkItemFactoryCallback1) (gpointer             callback_data,
                                            guint                callback_action,
                                            GtkWidget           *widget);
index 5f07d5e5a356fa1ce69a264c8641dc6ddc503772..e41a7935163e9c6421e3c6eff702fe757d96dace 100644 (file)
@@ -137,6 +137,8 @@ static gint  gtk_timeout_compare     (gconstpointer      a,
 const guint gtk_major_version = GTK_MAJOR_VERSION;
 const guint gtk_minor_version = GTK_MINOR_VERSION;
 const guint gtk_micro_version = GTK_MICRO_VERSION;
+const guint gtk_binary_age = GTK_BINARY_AGE;
+const guint gtk_interface_age = GTK_INTERFACE_AGE;
 
 static gboolean iteration_done = FALSE;
 static guint main_level = 0;
index d74d9bba8dd3a47e53051e77e144c2c72210615f..abbf5f428479bd33da905c9c1e2cfe9108396502 100644 (file)
@@ -26,6 +26,7 @@
 
 #ifdef __cplusplus
 extern "C" {
+#pragma }
 #endif /* __cplusplus */
 
 #define GTK_PRIORITY_HIGH      -20
@@ -42,6 +43,9 @@ typedef gint  (*GtkKeySnoopFunc)      (GtkWidget      *grab_widget,
 extern const guint gtk_major_version;
 extern const guint gtk_minor_version;
 extern const guint gtk_micro_version;
+extern const guint gtk_binary_age;
+extern const guint gtk_interface_age;
+
 
 /* Initialization, exit, mainloop and miscellaneous routines
  */
index 4d076c4e608bc44a4941e26e127f8762b243a8a7..d5ae15904a8c66f9ce624bb88c094fb41df42eec 100644 (file)
@@ -174,6 +174,8 @@ static void gtk_notebook_menu_item_create    (GtkNotebook      *notebook,
                                              GtkNotebookPage  *page,
                                              gint              position);
 static GtkType gtk_notebook_child_type       (GtkContainer     *container);
+static gint    gtk_notebook_find_page        (gconstpointer     a,
+                                             gconstpointer     b);
 
 
 static GtkContainerClass *parent_class = NULL;
@@ -225,10 +227,8 @@ gtk_notebook_class_init (GtkNotebookClass *class)
   gtk_object_add_arg_type ("GtkNotebook::enable_popup", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_ENABLE_POPUP);
 
   gtk_container_add_child_arg_type ("GtkNotebook::tab_label", GTK_TYPE_STRING, GTK_ARG_READWRITE, CHILD_ARG_TAB_LABEL);
-  /*
-   * gtk_container_add_child_arg_type ("GtkNotebook::menu_label", GTK_TYPE_STRING, GTK_ARG_READWRITE, CHILD_ARG_MENU_LABEL);
-   * gtk_container_add_child_arg_type ("GtkNotebook::position", GTK_TYPE_INT, GTK_ARG_READWRITE, CHILD_ARG_POSITION);
-   */
+  gtk_container_add_child_arg_type ("GtkNotebook::menu_label", GTK_TYPE_STRING, GTK_ARG_READWRITE, CHILD_ARG_MENU_LABEL);
+  gtk_container_add_child_arg_type ("GtkNotebook::position", GTK_TYPE_INT, GTK_ARG_READWRITE, CHILD_ARG_POSITION);
 
   notebook_signals[SWITCH_PAGE] =
     gtk_signal_new ("switch_page",
@@ -362,24 +362,23 @@ gtk_notebook_set_child_arg (GtkContainer     *container,
   GtkNotebook *notebook;
   GtkNotebookPage *page = NULL;
   GList *list;
+  gint position;
 
   notebook = GTK_NOTEBOOK (container);
 
-  for (list = notebook->children; list; list = list->next)
-    {
-      page = list->data;
-      if (page->child == child)
-       break;
-    }
-  if (!list)
-    return;
-
   switch (arg_id)
     {
     case CHILD_ARG_TAB_LABEL:
       /* a NULL pointer indicates a default_tab setting, otherwise
        * we need to set the associated label
        */
+
+      if (!(list = g_list_find_custom (notebook->children, child,
+                                      gtk_notebook_find_page)))
+       return;
+
+      page = list->data;
+
       if (GTK_VALUE_STRING (*arg))
        {
          page->default_tab = FALSE;
@@ -388,7 +387,12 @@ gtk_notebook_set_child_arg (GtkContainer     *container,
          page->tab_label = gtk_label_new (GTK_VALUE_STRING (*arg));
          gtk_widget_set_parent (page->tab_label, GTK_WIDGET (notebook));
          if (notebook->show_tabs)
-           gtk_widget_show (page->tab_label);
+           {
+             gtk_widget_show (page->tab_label);
+             gtk_notebook_pages_allocate
+               (notebook, &(GTK_WIDGET (notebook)->allocation));
+             gtk_notebook_expose_tabs (notebook);
+           }
        }
       else
        {
@@ -405,12 +409,49 @@ gtk_notebook_set_child_arg (GtkContainer     *container,
              page->tab_label = gtk_label_new (string);
              gtk_widget_set_parent (page->tab_label, GTK_WIDGET (notebook));
              gtk_widget_show (page->tab_label);
+             gtk_notebook_pages_allocate
+               (notebook, &(GTK_WIDGET (notebook)->allocation));
+             gtk_notebook_expose_tabs (notebook);
            }
        }
       break;
     case CHILD_ARG_MENU_LABEL:
+
+      for (position = 0, list = notebook->children; list;
+          list = list->next, position++)
+       {
+         page = list->data;
+         if (page->child == child)
+           break;
+       }
+
+      if (page->menu_label)
+       {
+         if (notebook->menu)
+           {
+             gtk_container_remove (GTK_CONTAINER (notebook->menu), 
+                                   page->menu_label->parent);
+             gtk_widget_queue_resize (notebook->menu);
+           }
+         if (!page->default_menu)
+           gtk_widget_unref (page->menu_label);
+       }
+      if (GTK_VALUE_STRING (*arg))
+       {
+         page->menu_label = gtk_label_new (GTK_VALUE_STRING (*arg));
+         gtk_widget_ref (page->menu_label);
+         gtk_object_sink (GTK_OBJECT(page->menu_label));
+         page->default_menu = FALSE;
+       }
+      else
+       page->default_menu = TRUE;
+
+      if (notebook->menu)
+       gtk_notebook_menu_item_create (notebook, page, position);
+
       break;
     case CHILD_ARG_POSITION:
+      gtk_notebook_reorder_child (notebook, child, GTK_VALUE_INT (*arg));
       break;
     default:
       break;
@@ -429,18 +470,15 @@ gtk_notebook_get_child_arg (GtkContainer     *container,
 
   notebook = GTK_NOTEBOOK (container);
 
-  for (list = notebook->children; list; list = list->next)
-    {
-      page = list->data;
-      if (page->child == child)
-       break;
-    }
-  if (!list)
+  if (!(list = g_list_find_custom (notebook->children, child,
+                                  gtk_notebook_find_page)))
     {
       arg->type = GTK_TYPE_INVALID;
       return;
     }
 
+  page = list->data;
+
   switch (arg_id)
     {
     case CHILD_ARG_TAB_LABEL:
@@ -455,8 +493,18 @@ gtk_notebook_get_child_arg (GtkContainer     *container,
        }
       break;
     case CHILD_ARG_MENU_LABEL:
+      if (page->default_menu)
+       GTK_VALUE_STRING (*arg) = NULL;
+      else
+       {
+         if (page->menu_label && GTK_IS_LABEL (page->menu_label))
+           GTK_VALUE_STRING (*arg) = g_strdup (GTK_LABEL (page->menu_label)->label);
+         else
+           GTK_VALUE_STRING (*arg) = NULL;
+       }
       break;
     case CHILD_ARG_POSITION:
+      GTK_VALUE_INT (*arg) = g_list_position (notebook->children, list);
       break;
     default:
       arg->type = GTK_TYPE_INVALID;
@@ -646,7 +694,7 @@ gtk_notebook_insert_page_menu (GtkNotebook *notebook,
   if (!notebook->cur_page)
     {
       gtk_notebook_switch_page (notebook, page, 0);
-      notebook->focus_tab = NULL;
+      gtk_notebook_switch_focus_tab (notebook, NULL);
     }
 
   if (GTK_WIDGET_VISIBLE (notebook))
@@ -694,8 +742,8 @@ gtk_notebook_remove_page (GtkNotebook *notebook,
     {
       list = g_list_last (notebook->children);
       if (list)
-       gtk_notebook_real_remove (notebook, list,
-                                 g_list_index (notebook->children, list->data));
+       gtk_notebook_real_remove
+         (notebook, list, g_list_index (notebook->children, list->data));
     }
 }
 
@@ -776,7 +824,7 @@ gtk_notebook_real_remove (GtkNotebook *notebook,
   if (list == notebook->first_tab)
     notebook->first_tab = next_list;
   if (list == notebook->focus_tab)
-    notebook->focus_tab = next_list;
+    gtk_notebook_switch_focus_tab (notebook, next_list);
   
   page = list->data;
   
@@ -845,7 +893,7 @@ gtk_notebook_current_page (GtkNotebook *notebook)
 
 void
 gtk_notebook_set_page (GtkNotebook *notebook,
-                      gint        page_num)
+                      gint         page_num)
 {
   GList *list;
   
@@ -946,6 +994,81 @@ gtk_notebook_prev_page (GtkNotebook *notebook)
   gtk_notebook_switch_page (notebook, page, num);
 }
 
+void
+gtk_notebook_reorder_child (GtkNotebook *notebook,
+                           GtkWidget   *child,
+                           gint         position)
+{
+  GList *list;
+  GtkNotebookPage *page;
+  gint old_pos;
+
+  g_return_if_fail (notebook != NULL);
+  g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
+  g_return_if_fail (child != NULL);
+  g_return_if_fail (GTK_IS_WIDGET (child));
+
+  for (old_pos = 0, list = notebook->children; list;
+       list = list->next, old_pos++)
+    {
+      page = list->data;
+      if (page->child == child)
+       break;
+    }
+
+  if (!list || old_pos == position)
+    return;
+
+  notebook->children = g_list_remove_link (notebook->children, list);
+  
+  if (position <= 0 || !notebook->children)
+    {
+      list->next = notebook->children;
+      if (list->next)
+       list->next->prev = list;
+      notebook->children = list;
+    }
+  else
+    {
+      GList *work;
+
+      if ((work = g_list_nth (notebook->children, position)))
+       {
+         list->prev = work->prev;
+         if (list->prev)
+           list->prev->next = list;
+         list->next = work;
+         work->prev = list;
+       }
+      else
+       {
+         work = g_list_last (notebook->children);
+         work->next = list;
+         list->prev = work;
+       }
+    }
+
+  if (notebook->menu)
+    {
+      GtkWidget *menu_item;
+
+      menu_item = page->menu_label->parent;
+      gtk_container_remove (GTK_CONTAINER (menu_item), page->menu_label);
+      gtk_container_remove (GTK_CONTAINER (notebook->menu), menu_item);
+      gtk_notebook_menu_item_create (notebook, page, position);
+      gtk_widget_queue_resize (notebook->menu);
+    }
+
+  gtk_notebook_update_labels (notebook, notebook->children, 1);
+
+  if (notebook->show_tabs)
+    {
+      gtk_notebook_pages_allocate (notebook,
+                                  &(GTK_WIDGET (notebook)->allocation));
+      gtk_notebook_expose_tabs (notebook);
+    }
+}
+
 static void
 gtk_notebook_foreach (GtkContainer *container,
                      GtkCallback   callback,
@@ -1836,12 +1959,12 @@ gtk_notebook_button_press (GtkWidget      *widget,
                  notebook->child_has_focus = FALSE;
                  old_page = (GtkNotebookPage *)
                              (notebook->focus_tab->data);
-                 notebook->focus_tab = children;
+                 gtk_notebook_switch_focus_tab (notebook, children);
                  gtk_notebook_focus_changed (notebook, old_page);
                }
              else
                {
-                 notebook->focus_tab = children;
+                 gtk_notebook_switch_focus_tab (notebook, children);
                  gtk_notebook_switch_page (notebook, page, num);
                  gtk_widget_grab_focus (widget);
                }
@@ -2062,6 +2185,12 @@ gtk_notebook_draw_arrow (GtkNotebook *notebook, guint arrow)
 
       if (arrow == GTK_ARROW_LEFT)
        {
+         if (notebook->focus_tab && !notebook->focus_tab->prev)
+           {
+             shadow_type = GTK_SHADOW_ETCHED_IN;
+             state_type = GTK_STATE_NORMAL;
+           }
+
          if (notebook->tab_pos == GTK_POS_LEFT ||
              notebook->tab_pos == GTK_POS_RIGHT)
            arrow = GTK_ARROW_UP;
@@ -2071,6 +2200,12 @@ gtk_notebook_draw_arrow (GtkNotebook *notebook, guint arrow)
        }
       else
        {
+         if (notebook->focus_tab && !notebook->focus_tab->next)
+           {
+             shadow_type = GTK_SHADOW_ETCHED_IN;
+             state_type = GTK_STATE_NORMAL;
+           }
+
          if (notebook->tab_pos == GTK_POS_LEFT ||
              notebook->tab_pos == GTK_POS_RIGHT)
            arrow = GTK_ARROW_DOWN;
@@ -2380,7 +2515,7 @@ gtk_notebook_set_focus_child (GtkContainer *container,
            {
              page = children->data;
              if (page->child == child || page->tab_label == child)
-               notebook->focus_tab = children;
+               gtk_notebook_switch_focus_tab (notebook, children);
              children = children->next;
            }
        }
@@ -3021,10 +3156,10 @@ gtk_notebook_focus (GtkContainer     *container,
     case GTK_DIR_RIGHT:
     case GTK_DIR_DOWN:
       if (!notebook->focus_tab)
-       notebook->focus_tab = notebook->children;
+       gtk_notebook_switch_focus_tab (notebook, notebook->children);
       else
-       notebook->focus_tab = notebook->focus_tab->next;
-      
+       gtk_notebook_switch_focus_tab (notebook, notebook->focus_tab->next);
+       
       if (!notebook->focus_tab)
        {
          gtk_notebook_focus_changed (notebook, old_page);
@@ -3034,13 +3169,15 @@ gtk_notebook_focus (GtkContainer     *container,
       page = notebook->focus_tab->data;
       return_val = TRUE;
       break;
+
     case GTK_DIR_TAB_BACKWARD:
     case GTK_DIR_LEFT:
     case GTK_DIR_UP:
       if (!notebook->focus_tab)
-       notebook->focus_tab = g_list_last (notebook->children);
+       gtk_notebook_switch_focus_tab
+         (notebook, g_list_last (notebook->children));
       else
-       notebook->focus_tab = notebook->focus_tab->prev;
+       gtk_notebook_switch_focus_tab (notebook, notebook->focus_tab->prev);
       
       if (!notebook->focus_tab)
        {
@@ -3117,28 +3254,61 @@ static void
 gtk_notebook_switch_focus_tab (GtkNotebook *notebook, 
                               GList       *new_child)
 {
+  GList *old_tab;
   GtkNotebookPage *old_page = NULL;
   GtkNotebookPage *page;
 
   g_return_if_fail (notebook != NULL);
   g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
 
-  if (notebook->focus_tab != new_child)
-    {
-      if (notebook->focus_tab)
-       old_page = notebook->focus_tab->data;
+  if (notebook->focus_tab == new_child)
+    return;
+    
+  old_tab = notebook->focus_tab;
+  notebook->focus_tab = new_child;
 
-      notebook->focus_tab = new_child;
-      page = notebook->focus_tab->data;
-      if (GTK_WIDGET_MAPPED (page->tab_label))
-       gtk_notebook_focus_changed (notebook, old_page);
+  if (notebook->scrollable)
+    {
+      if ((new_child == NULL) != (old_tab == NULL))
+       {
+         gdk_window_clear (notebook->panel);
+         gtk_notebook_draw_arrow (notebook, GTK_ARROW_LEFT);
+         gtk_notebook_draw_arrow (notebook, GTK_ARROW_RIGHT);
+         
+       }
       else
        {
-         gtk_notebook_pages_allocate (notebook, 
-                                      &(GTK_WIDGET (notebook)->allocation));
-         gtk_notebook_expose_tabs (notebook);
+         if ((old_tab->prev == NULL) != (new_child->prev == NULL))
+           {
+             gdk_window_clear_area (notebook->panel, 0, 0,
+                                    ARROW_SIZE, ARROW_SIZE);
+             gtk_notebook_draw_arrow (notebook, GTK_ARROW_LEFT);
+           }
+         if ((old_tab->next == NULL) != (new_child->next == NULL))
+           {
+             gdk_window_clear_area (notebook->panel,
+                                    ARROW_SIZE + ARROW_SPACING, 0,
+                                    ARROW_SIZE, ARROW_SIZE);
+             gtk_notebook_draw_arrow (notebook, GTK_ARROW_RIGHT);
+           }
        }
     }
+  
+  if (!notebook->focus_tab)
+    return;
+
+  if (old_tab)
+    old_page = old_tab->data;
+
+  page = notebook->focus_tab->data;
+  if (GTK_WIDGET_MAPPED (page->tab_label))
+    gtk_notebook_focus_changed (notebook, old_page);
+  else
+    {
+      gtk_notebook_pages_allocate (notebook,
+                                  &(GTK_WIDGET (notebook)->allocation));
+      gtk_notebook_expose_tabs (notebook);
+    }
 }
 
 static gint
@@ -3256,14 +3426,14 @@ gtk_notebook_menu_item_create (GtkNotebook     *notebook,
        page->menu_label = gtk_label_new ("");
       gtk_misc_set_alignment (GTK_MISC (page->menu_label), 0.0, 0.5);
     }
+
   gtk_widget_show (page->menu_label);
   menu_item = gtk_menu_item_new ();
   gtk_widget_freeze_accelerators (menu_item);
   gtk_container_add (GTK_CONTAINER (menu_item), page->menu_label);
   gtk_menu_insert (GTK_MENU (notebook->menu), menu_item, position);
   gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
-                     GTK_SIGNAL_FUNC (gtk_notebook_menu_switch_page), 
-                     page);
+                     GTK_SIGNAL_FUNC (gtk_notebook_menu_switch_page), page);
   gtk_widget_show (menu_item);
 }
 
@@ -3330,3 +3500,10 @@ gtk_notebook_menu_detacher (GtkWidget *widget,
 
   notebook->menu = NULL;
 }
+
+static gint
+gtk_notebook_find_page (gconstpointer    a,
+                       gconstpointer    b)
+{
+  return (((GtkNotebookPage *) a)->child != b);
+}
index 183b7ee5050bfb43856dd433b414e7dda0f272fa..2efb2a227d1c75c60f212890867c24e8425bc2d0 100644 (file)
@@ -121,6 +121,9 @@ void       gtk_notebook_set_page          (GtkNotebook      *notebook,
                                           gint              page_num);
 void       gtk_notebook_next_page         (GtkNotebook      *notebook);
 void       gtk_notebook_prev_page         (GtkNotebook      *notebook);
+void       gtk_notebook_reorder_child     (GtkNotebook      *notebook,
+                                          GtkWidget        *child,
+                                          gint              position);
 void       gtk_notebook_set_tab_pos       (GtkNotebook      *notebook,
                                           GtkPositionType   pos);
 void       gtk_notebook_set_show_tabs     (GtkNotebook      *notebook,
index 020d323708e67c648cc51b1637e08354da4f77a5..98fe667589f8469af2673df182fa9cfd7edad3c2 100644 (file)
@@ -1273,7 +1273,6 @@ gtk_default_draw_polygon (GtkStyle      *style,
     }
 }
 
-
 static void
 gtk_default_draw_arrow (GtkStyle      *style,
                        GdkWindow     *window,
@@ -1311,6 +1310,18 @@ gtk_default_draw_arrow (GtkStyle      *style,
       gc3 = style->black_gc;
       gc4 = style->bg_gc[state_type];
       break;
+    case GTK_SHADOW_ETCHED_IN:
+      gc1 = style->light_gc[state_type];
+      gc2 = style->dark_gc[state_type];
+      gc3 = NULL;
+      gc4 = NULL;
+      break;
+    case GTK_SHADOW_ETCHED_OUT:
+      gc1 = style->dark_gc[state_type];
+      gc2 = style->light_gc[state_type];
+      gc3 = NULL;
+      gc4 = NULL;
+      break;
     default:
       return;
     }
@@ -1340,27 +1351,60 @@ gtk_default_draw_arrow (GtkStyle      *style,
           gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, 3);
         }
 
-      gdk_draw_line (window, gc1,
-                     x + 1, y + height - 2,
-                     x + width - 2, y + height - 2);
-      gdk_draw_line (window, gc3,
-                     x + 0, y + height - 1,
-                     x + width - 1, y + height - 1);
+      switch (shadow_type)
+       {
+       case GTK_SHADOW_IN:
+       case GTK_SHADOW_OUT:
+         
+         gdk_draw_line (window, gc1,
+                        x + 1, y + height - 2,
+                        x + width - 2, y + height - 2);
+         gdk_draw_line (window, gc3,
+                        x + 0, y + height - 1,
+                        x + width - 1, y + height - 1);
+         
+         gdk_draw_line (window, gc1,
+                        x + width - 2, y + height - 1,
+                        x + half_width, y + 1);
+         gdk_draw_line (window, gc3,
+                        x + width - 1, y + height - 1,
+                        x + half_width, y);
+         
+         gdk_draw_line (window, gc4,
+                        x + half_width, y + 1,
+                        x + 1, y + height - 1);
+         gdk_draw_line (window, gc2,
+                        x + half_width, y,
+                        x, y + height - 1);
+         break;
 
-      gdk_draw_line (window, gc1,
-                     x + width - 2, y + height - 1,
-                     x + half_width, y + 1);
-      gdk_draw_line (window, gc3,
-                     x + width - 1, y + height - 1,
-                     x + half_width, y);
+       case GTK_SHADOW_ETCHED_IN:
+       case GTK_SHADOW_ETCHED_OUT:
+         gdk_draw_line (window, gc1,
+                        x + half_width, y + 1,
+                        x + 1, y + height - 1);
+         gdk_draw_line (window, gc1,
+                        x + 1, y + height - 1,
+                        x + width - 1, y + height - 1);
+         gdk_draw_line (window, gc1,
+                        x + width - 1, y + height - 1,
+                        x + half_width + 1, y + 1);
+         
+          points[0].x = x + half_width;
+          points[0].y = y;
+          points[1].x = x;
+          points[1].y = y + height - 2;
+          points[2].x = x + width - 2;
+          points[2].y = y + height - 2;
 
-      gdk_draw_line (window, gc4,
-                     x + half_width, y + 1,
-                     x + 1, y + height - 1);
-      gdk_draw_line (window, gc2,
-                     x + half_width, y,
-                     x, y + height - 1);
+          gdk_draw_polygon (window, gc2, FALSE, points, 3);
+         break;
+
+       default:
+         break;
+       }
       break;
+
     case GTK_ARROW_DOWN:
       if (fill)
         {
@@ -1373,27 +1417,57 @@ gtk_default_draw_arrow (GtkStyle      *style,
 
           gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, 3);
         }
+      switch (shadow_type)
+       {
+       case GTK_SHADOW_IN:
+       case GTK_SHADOW_OUT:
+         gdk_draw_line (window, gc4,
+                        x + width - 2,
+                        y + 1, x + 1, y + 1);
+         gdk_draw_line (window, gc2,
+                        x + width - 1, y,
+                        x, y);
+         
+         gdk_draw_line (window, gc4,
+                        x + 1, y,
+                        x + half_width, y + height - 2);
+         gdk_draw_line (window, gc2,
+                        x, y,
+                        x + half_width, y + height - 1);
 
-      gdk_draw_line (window, gc4,
-                     x + width - 2,
-                     y + 1, x + 1, y + 1);
-      gdk_draw_line (window, gc2,
-                     x + width - 1, y,
-                     x, y);
+         gdk_draw_line (window, gc1,
+                        x + half_width, y + height - 2,
+                        x + width - 2, y);
+         gdk_draw_line (window, gc3,
+                        x + half_width, y + height - 1,
+                        x + width - 1, y);
+         break;
 
-      gdk_draw_line (window, gc4,
-                     x + 1, y,
-                     x + half_width, y + height - 2);
-      gdk_draw_line (window, gc2,
-                     x, y,
-                     x + half_width, y + height - 1);
+       case GTK_SHADOW_ETCHED_IN:
+       case GTK_SHADOW_ETCHED_OUT:
+         gdk_draw_line (window, gc1,
+                        x + width - 1, y + 1,
+                        x + 1, y + 1);
+         gdk_draw_line (window, gc1,
+                        x + 1, y + 1,
+                        x + half_width + 1, y + height - 1);
+         gdk_draw_line (window, gc1,
+                        x + half_width + 1, y + height - 2,
+                        x + width - 1, y);
+         
+          points[0].x = x + width - 2;
+          points[0].y = y;
+          points[1].x = x;
+          points[1].y = y;
+          points[2].x = x + half_width;
+          points[2].y = y + height - 2;
 
-      gdk_draw_line (window, gc1,
-                     x + half_width, y + height - 2,
-                     x + width - 2, y);
-      gdk_draw_line (window, gc3,
-                     x + half_width, y + height - 1,
-                     x + width - 1, y);
+          gdk_draw_polygon (window, gc2, FALSE, points, 3);
+         break;
+
+       default:
+         break;
+       }
       break;
     case GTK_ARROW_LEFT:
       if (fill)
@@ -1408,26 +1482,57 @@ gtk_default_draw_arrow (GtkStyle      *style,
           gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, 3);
         }
 
-      gdk_draw_line (window, gc1,
-                     x + 1, y + half_height,
-                     x + width - 1, y + height - 1);
-      gdk_draw_line (window, gc3,
-                     x, y + half_height,
-                     x + width - 1, y + height - 1);
+      switch (shadow_type)
+       {
+       case GTK_SHADOW_IN:
+       case GTK_SHADOW_OUT:
+         gdk_draw_line (window, gc1,
+                        x + 1, y + half_height,
+                        x + width - 1, y + height - 1);
+         gdk_draw_line (window, gc3,
+                        x, y + half_height,
+                        x + width - 1, y + height - 1);
 
-      gdk_draw_line (window, gc1,
-                     x + width - 2, y + height - 1,
-                     x + width - 2, y + 1);
-      gdk_draw_line (window, gc3,
-                     x + width - 1, y + height - 1,
-                     x + width - 1, y);
-
-      gdk_draw_line (window, gc4,
-                     x + width - 1, y + 1,
-                     x + 1, y + half_height);
-      gdk_draw_line (window, gc2,
-                     x + width - 1, y,
-                     x, y + half_height);
+         gdk_draw_line (window, gc1,
+                        x + width - 2, y + height - 1,
+                        x + width - 2, y + 1);
+         gdk_draw_line (window, gc3,
+                        x + width - 1, y + height - 1,
+                        x + width - 1, y);
+
+         gdk_draw_line (window, gc4,
+                        x + width - 1, y + 1,
+                        x + 1, y + half_height);
+         gdk_draw_line (window, gc2,
+                        x + width - 1, y,
+                        x, y + half_height);
+         break;
+
+       case GTK_SHADOW_ETCHED_IN:
+       case GTK_SHADOW_ETCHED_OUT:
+         gdk_draw_line (window, gc1,
+                        x + width - 1, y + 1,
+                        x + 1, y + half_height);
+         gdk_draw_line (window, gc1,
+                        x + 1, y + half_height + 1,
+                        x + width - 1, y + height - 1);
+         gdk_draw_line (window, gc1,
+                        x + width - 1, y + height - 1,
+                        x + width - 1, y + 1);
+         
+          points[0].x = x + width - 2;
+          points[0].y = y;
+          points[1].x = x;
+          points[1].y = y + half_height;
+          points[2].x = x + width - 2;
+          points[2].y = y + height - 2;
+
+          gdk_draw_polygon (window, gc2, FALSE, points, 3);
+         break;
+
+       default:
+         break;
+       }
       break;
     case GTK_ARROW_RIGHT:
       if (fill)
@@ -1442,31 +1547,61 @@ gtk_default_draw_arrow (GtkStyle      *style,
           gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, 3);
         }
 
-      gdk_draw_line (window, gc4,
-                     x + width - 1, y + half_height,
-                     x + 1, y + 1);
-      gdk_draw_line (window, gc2,
-                     x + width - 1, y + half_height,
-                     x, y);
+      switch (shadow_type)
+       {
+       case GTK_SHADOW_IN:
+       case GTK_SHADOW_OUT:
+         gdk_draw_line (window, gc4,
+                        x + width - 1, y + half_height,
+                        x + 1, y + 1);
+         gdk_draw_line (window, gc2,
+                        x + width - 1, y + half_height,
+                        x, y);
 
-      gdk_draw_line (window, gc4,
-                     x + 1, y + 1,
-                     x + 1, y + height - 2);
-      gdk_draw_line (window, gc2,
-                     x, y,
-                     x, y + height - 1);
+         gdk_draw_line (window, gc4,
+                        x + 1, y + 1,
+                        x + 1, y + height - 2);
+         gdk_draw_line (window, gc2,
+                        x, y,
+                        x, y + height - 1);
 
-      gdk_draw_line (window, gc1,
-                     x + 1, y + height - 2,
-                     x + width - 1, y + half_height);
-      gdk_draw_line (window, gc3,
-                     x, y + height - 1,
-                     x + width - 1, y + half_height);
+         gdk_draw_line (window, gc1,
+                        x + 1, y + height - 2,
+                        x + width - 1, y + half_height);
+         gdk_draw_line (window, gc3,
+                        x, y + height - 1,
+                        x + width - 1, y + half_height);
+         break;
+
+       case GTK_SHADOW_ETCHED_IN:
+       case GTK_SHADOW_ETCHED_OUT:
+         gdk_draw_line (window, gc1,
+                        x + width - 1, y + half_height + 1,
+                        x + 1, y + 1);
+         gdk_draw_line (window, gc1,
+                        x + 1, y + 1,
+                        x + 1, y + height - 1);
+         gdk_draw_line (window, gc1,
+                        x + 1, y + height - 1,
+                        x + width - 1, y + half_height + 1);
+         
+          points[0].x = x + width - 2;
+          points[0].y = y + half_height;
+          points[1].x = x;
+          points[1].y = y;
+          points[2].x = x;
+          points[2].y = y + height - 1;
+
+          gdk_draw_polygon (window, gc2, FALSE, points, 3);
+         break;
+
+       default:
+         break;
+       }
       break;
     }
 }
 
-
 static void
 gtk_default_draw_diamond (GtkStyle      *style,
                          GdkWindow     *window,
index 57c1d092f61ac4fecaff855f4f2abb8b930ae704..af66787b2f6785c087e1fbd15becd644fd625a66 100644 (file)
@@ -100,7 +100,7 @@ typedef struct _GtkEnumValue   GtkFlagValue;
 
 typedef void (*GtkClassInitFunc)   (gpointer   klass);
 typedef void (*GtkObjectInitFunc)  (gpointer   object);
-typedef void (*GtkSignalFunc)      (void);
+typedef void (*GtkSignalFunc)      ();
 typedef gint (*GtkFunction)       (gpointer   data);
 typedef void (*GtkDestroyNotify)   (gpointer   data);
 typedef void (*GtkCallbackMarshal) (GtkObject *object,
index 5bd02f3d2785eaae69733cb472169b31731c3a68..a9805e260d9d779ef2f05a4d2a74dd88f7b8690f 100644 (file)
@@ -7445,6 +7445,10 @@ create_main_window (void)
   gtk_widget_show (window);
 }
 
+#ifdef HAVE_LIBGLE
+#include <gle/gle.h>
+#endif /* !HAVE_LIBGLE */
+
 int
 main (int argc, char *argv[])
 {
index 5bd02f3d2785eaae69733cb472169b31731c3a68..a9805e260d9d779ef2f05a4d2a74dd88f7b8690f 100644 (file)
@@ -7445,6 +7445,10 @@ create_main_window (void)
   gtk_widget_show (window);
 }
 
+#ifdef HAVE_LIBGLE
+#include <gle/gle.h>
+#endif /* !HAVE_LIBGLE */
+
 int
 main (int argc, char *argv[])
 {